package com.github.shiqiyue.learn.design.pattern.factory.simple;

import com.github.shiqiyue.learn.design.pattern.factory.*;

/***
 *
 * @author wenyao.wu
 * @date 2019/2/12
 */
public class SimpleFactory {

    public static Item get(String type){
        if(type.equals("apple")){
            return new Apple();
        }
        if(type.equals("orange")){
            return new Orange();
        }
        if(type.equals("baoma")){
            return new Baoma();
        }
        if(type.equals("bengchi")){
            return new Bengchi();
        }
        return null;
    }
}
